package com.qs.redis.utils;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

/**
 * 获取redis连接工具类
 *
 * @author qinyupeng
 * @since 2019年12月8日23:09:01
 */
public class JedisConnectionUtils {

    private static JedisPool jedisPool = null;

    static {
        JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
        jedisPoolConfig.setMaxTotal(100);
        jedisPool = new JedisPool(jedisPoolConfig, "172.16.109.130");
    }

    public static Jedis getJedis() {
        return jedisPool.getResource();
    }
}